home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / cvs-1.8 / cvs-1 / cvs-1.8.1 / src / myndbm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-06  |  1.2 KB  |  48 lines

  1. /* $CVSid: @(#)myndbm.h 1.4 94/09/21 $     */
  2.  
  3. #ifdef MY_NDBM
  4.  
  5. #define    DBLKSIZ    4096
  6.  
  7. typedef struct
  8. {
  9.     List *dbm_list;            /* cached database */
  10.     Node *dbm_next;            /* next key to return for nextkey() */
  11.  
  12.     /* Name of the file to write to if modified is set.  malloc'd.  */
  13.     char *name;
  14.  
  15.     /* Nonzero if the database has been modified and dbm_close needs to
  16.        write it out to disk.  */
  17.     int modified;
  18. } DBM;
  19.  
  20. typedef struct
  21. {
  22.     char *dptr;
  23.     int dsize;
  24. } datum;
  25.  
  26. /*
  27.  * So as not to conflict with other dbm_open, etc., routines that may
  28.  * be included by someone's libc, all of my emulation routines are prefixed
  29.  * by "my" and we define the "standard" ones to be "my" ones here.
  30.  */
  31. #define    dbm_open    mydbm_open
  32. #define    dbm_close    mydbm_close
  33. #define    dbm_fetch    mydbm_fetch
  34. #define    dbm_firstkey    mydbm_firstkey
  35. #define    dbm_nextkey    mydbm_nextkey
  36. #define dbm_store    mydbm_store
  37. #define  DBM_INSERT  0
  38. #define  DBM_REPLACE 1
  39.  
  40. DBM *mydbm_open PROTO((char *file, int flags, int mode));
  41. void mydbm_close PROTO((DBM * db));
  42. datum mydbm_fetch PROTO((DBM * db, datum key));
  43. datum mydbm_firstkey PROTO((DBM * db));
  44. datum mydbm_nextkey PROTO((DBM * db));
  45. extern int mydbm_store PROTO ((DBM *, datum, datum, int));
  46.  
  47. #endif                /* MY_NDBM */
  48.